<?php
class YahooHelper {
	public static function isOnline($nick = '') {
		$url = 'http://opi.yahoo.com/online?u='.$nick;
		$content = file_get_contents($url);
		return strlen($content)==140;
		//echo($content);die;
		
		/*$ch = curl_init($url);
		curl_setopt($ch, CURLOPT_URL, $url);
		curl_setopt($ch, CURLOPT_HEADER, 0);
		
		ob_start();
		curl_exec($ch);
		$content = ob_get_contents();
		curl_close($ch);
		ob_get_clean();
		
		if (trim(strtolower(strip_tags($content))) != 'user not specified.') {
			return (strlen($content) == 140);
		}*/
		//return false;
	}
}
?>